This page last changed on Nov 29, 2004 by jcarreira.

Param

设置父标签的参数. 如包含在ww:url和ww:action中.
<ww:action name="VelocityCounter" id="vc">
 <ww:param name="foo" value="'BAR'"/>
</ww:action>
javascript:popUp('<ww:url value="wiki.opensymphony.com/exec/edit"><ww:param name="name" value="Common Tags"/></ww:url>')

摘自webwork.tld:
<attribute>
   <name>name</name>
   <required>true</required>
   <rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
   <name>value</name>
   <required>false</required>
   <rtexprvalue>true</rtexprvalue>
</attribute>

Property

用于获取结果属性的值. 如果value未给定, 将使用栈顶值.
<ww:property value="id" default="#session[OS:'customer'].id"/>

摘自webwork.tld:
<attribute>
   <name>value</name>
   <required>false</required>
   <rtexprvalue>true</rtexprvalue>
 </attribute>
 <attribute>
    <name>default</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
 </attribute>

Push

使用ww:push可以将一个值压入值栈. 这与ww:set(见下文)类似, 因此在决定使用前应当都看一下.
<ww:push value="counter">
  <ww:property value="count"/>
</ww:push>


To make an action available on the stack:

<ww:action name="'SomeAction'" id="sa"/>
<ww:push value="#sa">
 foo = <ww:property value="foo"/>
</ww:push>

摘自webwork.tld:
<attribute>
   <name>value</name>
   <required>true</required>
   <rtexprvalue>true</rtexprvalue>
</attribute>

Set

使用ww:set标签, 你可以在JSP中创建一个自己命名变量. 可以使用#variableName的形式引用该变量.
<ww:set name="huba" value="foo.bar" scope="webwork" />

<ww:property value="#huba.otherExpression().baz"/>)

摘自webwork.tld:
<info>
   Sets the value of an object in the VS to a scope
   (page, stack, application, session). If the value
   is not given, the top of the stack is used. If the
   scope is not given, the default scope of "webwork"
   is used.
</info>
<attribute>
   <name>name</name>
   <required>true</required>
   <rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
   <name>value</name>
   <required>false</required>
   <rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
   <name>scope</name>
   <required>false</required>
   <rtexprvalue>true</rtexprvalue>
</attribute>

Url

该标签构造一个编码的URL. 该标签的最简版本, <ww:url/>, 输出本页面的相对URL. 下面是例子:
/jsp/cart.jsp?template=%5BLjava.lang.String%3B%40e29f36&id=%5BLjava.lang.String%3B%40429be9
下面是更长的例子:
<ww:url value="www.google.com/search">
  <ww:param name="sourceid" value="'navclient'"/>
  <ww:param name="ie" value="'UTF-8'"/>
  <ww:param name="oe" value="'UTF-8'"/>
  <ww:param name="q" value="'webwork'"/>
</ww:url>

输出结果为:
http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=webwork

摘自webwork.tld:

<attribute>
   <name>value</name>
   <required>false</required>
   <rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
    <name>id</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
</attribute>

Document generated by Confluence on Dec 14, 2004 16:36